package com.ftg.learn.dept.controller;

import com.ftg.learn.dept.mapper.DeptMapper;
import com.ftg.learn.dept.pojo.Dept;
import com.ftg.learn.dept.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/Dept")
public class DeptController {

    @Autowired
    DeptService deptService;

    @GetMapping("/showAll")
    public List<Dept> showAll(){

        return deptService.showAll();
    }
}
